package com.wx.entity;

import com.wx.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@Table(name = "sys_dict")
@ApiModel(value = "sysDict")
public class SysDict extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -7552460067089262694L;

    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    @Column(name = "dict_code")
    private String dictCode;


    /**
     * 值
     */
    @Length(min = 2, max = 64, message = "{dict.value.length}")
    @Column(name = "dict_value")
    private String dictValue;

    /**
     * lable
     */
    @Pattern(regexp = "^[\\u4e00-\\u9faf]+$", message = "{dict.label.pattern}")
    @Length(min = 2, max = 64, message = "{dict.label.length}")
    @Column(name = "dict_name")
    private String dictName;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 级别
     */
    private Integer level;

    /**
     * 父id
     */
    @Column(name = "parent_code")
    private String parentCode;

}